package com.neuedu.mvc.service.impl;

import com.neuedu.mvc.dao.UserDao;
import com.neuedu.mvc.entity.User;
import com.neuedu.mvc.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 项目：      spring-framework
 * 类名:       UserServiceImpl
 * 创建时间：  2024/3/19 09：28
 * 描述 :
 * 作者 :     张金山
 * QQ :     314649444
 * Site:      https://jshand.gitee.io
 */
@Service
public class UserServiceImpl implements IUserService {
    @Autowired
    private UserDao userDao;
    @Override
    public List<Map<String, Object>> selectListMap() {
        return userDao.selectListMap();
    }

    @Override
    public List<User> selectListEntity() {
        return userDao.selectListEntity();
    }

    @Override
    public User selectByIdEntiry(int id) {
        return userDao.selectByIdEntiry(id);
    }

    @Override
    public User selectById(int id) {
        return userDao.selectByIdEntiry(id);
    }

    @Override
    public int selectCount() {
        return userDao.selectCount();
    }

    @Override
    public boolean insert(User user) {
        return userDao.insert(user)>0;
    }

    @Override
    public boolean updateById(User user) {
        return userDao.updateById(user)>0;
    }

    @Override
    public boolean deleteById(int id) {
        return userDao.deleteById(id)>0;
    }
}
